<!doctype html public "-//w3c//dtd html 4.0 transitional//en">


<!-- WARNING! This file is generated. -->
<!-- To alter documentation, edit files in src directory -->


<html><head>
<title>utRecEq Package</title>
<link rel="stylesheet" href="utplsql.css" content="text/css">
<meta name="keywords" content="utPLSQL, PL\SQL, Unit Testing, Framework, Oracle"/>
<meta name="description" content="Unit Testing PL\SQL"/>
<meta name="title" content="utRecEq Package"/>
<meta name="author" content="Steven Feuerstein, Chris Rimmer, Patrick Barel"/>
<meta name="copyright" content="(C) 2000-2005 Steven Feuerstein, Chris Rimmer, Patrick Barel"/>
</head><body>
<div class="purple_bar"><a href="index.html"><img src="utplsql.jpg" border=0></a></div>
<p>[ <A href="index.html">Home</A>
 | <A href="started.html">Getting Started</A>
 | <A href="buildpack.html">Build Test Packages</A>
 | <A href="examples.html">Examples</A>
 | <A href="userguide.html">User Guide</A>
 | <A href="release.html">Release Notes</A>
 | <A href="map.html">Document Map</A> ]</p>
<p><A href="utoutput.html">&lt; Previous Section: utOutput Package</A> | <A href="defsuite.html">Next Section: Defining Test Suites &gt;</A></p>
<!-- Begin utPLSQL Body -->
<!-- $Id: utreceq.html,v 1.1 2002/07/31 15:48:37 chrisrimmer Exp $ -->
<h1>
   utRecEq Package
</h1>

<p>This package contains the following procedures and functions:
<br> 
<table cellspacing="5">
<tr>
<tr>
   <td width="25%"><a href="#Add">utRecEq.add</a></td>
   <td><a href="#Add">Add a record type comparison function</a></td>
</tr>
<tr>
   <td width="25%"><a href="#Compile">utRecEq.compile</a></td> 
   <td><a href="#Compile">Compile a package's record type comparison functions</a></td>
</tr>
<tr>
   <td width="25%"><a href="#Rem">utRecEq.rem</a></td>
   <td><a href="#Rem">Remove record type comparison functions</a></td>
</tr>
</table>

<h2><a name="Add"></a>Generate functions to compare record types</h2>

<p>This package (created by Dan Spencer) allows the creation of functions to
allow the comparison of record types based on tables or views  (%ROWTYPE
records in other words).  They are generated by the add procedure:

<pre>PROCEDURE add(
   pkg_name_in IN ut_package.name%TYPE,
   record_in  IN ut_receq.name%TYPE,
   rec_owner_in  IN ut_receq.created_by%TYPE := USER
);</pre>

The pkg_name_in parameter contains the name of a tested package you wish to
associate with this record type. Note that this package name should already
exist in the ut_package table.  The record_in parameter contains the name of
the view or table whose record type is to be compared.  The final (optional)
parameter contains the name of the schema in which the table or view exists.
It defaults to the current user.</p>

<p>The generated function will be named EQ_{Record_Schema_}Record_Name. The
schema is only inserted when the record type is not within the current one. The
function will return TRUE if the two records are identical on a field-by-field
comparison and FALSE otherwise.  Note that NULL fields are considered
equal.</p>

<p>The details of the EQ_* functions and their association with tested packages held in two tables:
<ul>
   
   <li>UT_RECEQ - This table holds a list of the EQ_* functions including the
   target table/view and the schema in which it is found.</li>
   
   <li>UT_RECEQ_PKG - This table cross-references the tested packages against the functions listed in UT_RECEQ.</li>

</ul></p>

<h2><a name="Compile"></a>Compile a package's record comparison functions</h2>

<p>This routine recompiles all the EQ_* functions associated with a given package:

<pre>PROCEDURE compile(pkg_name_in IN ut_package.name%TYPE);</pre>

when <a href="utconfig.html#Autocompile">autocompiling</a> is turned on, this is called by 
utplsql.test or utplsql.testsuite before the test packages themselves are recompiled.</p>

<h2><a name="Rem"></a>Remove record comparison functions</h2>

<p>To remove record comparison functions, use the following:

<pre>PROCEDURE rem(
   name_in  IN ut_receq.name%TYPE,
   rec_owner_in   IN ut_receq.created_by%TYPE := USER
   for_package_in IN BOOLEAN := FALSE
);</pre>

If for_package_in is FALSE, then name_in is taken to refer to a record type to
remove, with rec_owner_in specifying the schema the record type is in.  All package associations for this record type are removed and the EQ_* function is dropped.</p> 

<p>On the other hand, if for_package_in is TRUE, then name_in is taken to refer
to a package.  In this case, all the package's associations are removed.  If no
other package is associated with a given record, then the EQ_* function is
dropped.  (Note that the rec_owner_in parameter is ignored here).</p>

<!-- End utPLSQL Body -->
<p><A href="utoutput.html">&lt; Previous Section: utOutput Package</A> | <A href="defsuite.html">Next Section: Defining Test Suites &gt;</A></p>
<div class="purple_bar"><a href="index.html"><img src="utplsql.jpg" border=0></a></div>
<p class="copyright">Copyright (C) 2000-2005 <A href="mailto:steven@stevenfeuerstein.com">Steven Feuerstein<A>, <A href="mailto:c@24.org.uk">Chris Rimmer<A>, <A href="mailto:pbarel@vda.nl">Patrick Barel<A> All rights reserved</p>
</body></html>